]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-widget: Fix a potentially infinite recursion
authorRui Matos <tiagomatos@gmail.com>
Thu, 21 Jan 2016 15:39:58 +0000 (16:39 +0100)
committerRui Matos <tiagomatos@gmail.com>
Thu, 21 Jan 2016 15:49:05 +0000 (16:49 +0100)
Commit ffe4eaf00d8780bdc6fb3d7aca3eda847e887007 changed this code to
call st_widget_get_accessible_role() instead of using the value
directly which would be an infinite recursion if that function didn't
have a bug. As it is, this just resulted in

CRITICAL **: atk_object_get_role: assertion 'ATK_IS_OBJECT
(accessible)' failed

https://bugzilla.gnome.org/show_bug.cgi?id=760945

src/st/st-widget.c

index 6191e0521bf27e892bfb8bdc1b8aa983cf62b5b7..0f1a34e7beadb568dc2dab986e43eef514040611 100644 (file)
@@ -2785,7 +2785,7 @@ static AtkRole
 st_widget_accessible_get_role (AtkObject *obj)
 {
   StWidget *widget = NULL;
-  AtkRole role;
+  StWidgetPrivate *priv;
 
   g_return_val_if_fail (ST_IS_WIDGET_ACCESSIBLE (obj), ATK_ROLE_INVALID);
 
@@ -2794,9 +2794,9 @@ st_widget_accessible_get_role (AtkObject *obj)
   if (widget == NULL)
     return ATK_ROLE_INVALID;
 
-  role = st_widget_get_accessible_role (widget);
-  if (role != ATK_ROLE_INVALID)
-    return role;
+  priv = st_widget_get_instance_private (widget);
+  if (priv->accessible_role != ATK_ROLE_INVALID)
+    return priv->accessible_role;
 
   return ATK_OBJECT_CLASS (st_widget_accessible_parent_class)->get_role (obj);
 }